fix(bump_builder): preserve block height when publishing mined status (#87)#123
Merged
Conversation
…#87) The mined-status update path was dropping blockHeight between InsertBUMP and SetMinedByTxIDs (or the subsequent publish), so downstream consumers received MINED statuses with a zero or unset height. Block height is now threaded through the whole call chain and asserted in tests. Closes F-029.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Store.SetMinedByTxIDsnow takesblockHeight uint64; postgres / aerospike / pebble all persist the height alongsideblock_hashand echo it back on each returnedTransactionStatus.bump_builder.BuilderthreadsblockHeight(lifted from the compound BUMP) intoSetMinedByTxIDsand adds a defensive top-up on the publish path so a partial regression in any backend cannot reintroduce a zero-height MINED update.services/bump_builder/builder_test.go(arecordingPublishermock, an explicit non-trivial height case viatransaction.NewMerklePath, a "height never zero" guard, and a "publish path repairs a buggy backend" test).Closes #87 (F-029).
Where the height was being lost
services/bump_builder/builder.gocapturedblockHeightforInsertBUMPthen calledb.store.SetMinedByTxIDs(ctx, blockHash, txids)— no height. Every backend implementation ofSetMinedByTxIDstherefore wrote onlyblock_hashand builtmodels.TransactionStatuswithBlockHeightzero-valued, which the publisher then fanned out to SSE / webhook subscribers verbatim.Test plan
go build ./...go vet ./...(andgo vet -tags=postgres ./...,-tags=integration,-tags=aerospikeclean)go test ./services/bump_builder/... ./store/... -count=1 -racegolangci-lint run ./services/bump_builder/... ./store/...— 0 issues